package com.ssy.common;

/**
 * Result
 *
 * @author ssy
 * @date 2020/11/11
 **/
public class Result {

    /**
     * 业务状态码
     */
    private Integer code;

    /**
     * 业务消息
     */
    private String msg;

    /**
     * 业务数据
     */
    private Object data;

    /**
     * 操作成功没有数据的
     */
    public Result() {
        this.code = CodeMsg.SUCCES.getCode();
        this.msg = CodeMsg.SUCCES.getMsg();
    }

    /**
     * 操作失败的
     *
     * @param codeMsg
     */
    public Result(CodeMsg codeMsg) {
        this.code = codeMsg.getCode();
        this.msg = codeMsg.getMsg();
    }

    public Result(Object data) {
        this.code = CodeMsg.SUCCES.getCode();
        this.msg = CodeMsg.SUCCES.getMsg();
        this.data = data;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
